package com.buka.communicate.activity;

import android.view.View;
import android.widget.LinearLayout;

import com.buka.communicate.R;
import com.buka.communicate.adapter.WorkTagAdapter;
import com.buka.communicate.entity.WorkTag;

import net.neiquan.applibrary.base.BaseActivity;
import net.neiquan.applibrary.base.BaseListActivity;
import net.neiquan.applibrary.base.MyBaseAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/11/13 0013.
 */

public class WorkTagActivity extends BaseListActivity {

    @Override
    protected boolean isHaveHead() {
        return true;
    }

    @Override
    protected void setHeadViews() {
        getNextTv().setTextColor(getResources().getColor(R.color.app_color));
        setNextTv("保存");
        setTitleTv("行业");
    }

    @Override
    protected MyBaseAdapter getAdapter() {
        return new WorkTagAdapter(this, null);
    }

    @Override
    protected int getLineNum() {
        return 0;
    }

    @Override
    public void initData() {
        mRecyclerview.setPullRefreshEnabled(false);
        mRecyclerview.setLoadingMoreEnabled(false);
        mRecyclerview.hideFootView();
        initTagDatas();
        adapter.setOnItemClickListener(new MyBaseAdapter.OnRecyclerViewItemClickListener() {
            @Override
            public void onItemClick(View view, List data, int position) {
                for (int i = 0; i < data.size(); i++) {
                    ((WorkTag) data.get(i)).setChosen(false);
                }
                ((WorkTag) data.get(position)).setChosen(true);
                adapter.notifyDataSetChanged();
            }
        });
    }

    private void initTagDatas() {
        WorkTag workTagIT = new WorkTag();
        workTagIT.setBgDrawable(R.drawable.shape_cornor_app_corlor);
        workTagIT.setTitle("   IT   ");
        workTagIT.setContent("计算机/互联网/通信");
        adapter.appendSingle(workTagIT);
        WorkTag workTagMake = new WorkTag();
        workTagMake.setBgDrawable(R.drawable.shape_cornor_app_corlor);
        workTagMake.setTitle("制造");
        workTagMake.setContent("生产/工艺/制造");
        adapter.appendSingle(workTagMake);
        WorkTag workTagMedical = new WorkTag();
        workTagMedical.setBgDrawable(R.drawable.shape_cornor_app_corlor);
        workTagMedical.setTitle("医疗");
        workTagMedical.setContent("医疗/护理/制药");
        adapter.appendSingle(workTagMedical);
        WorkTag workTagMoney = new WorkTag();
        workTagMoney.setBgDrawable(R.drawable.shape_cornor_app_corlor);
        workTagMoney.setTitle("金融");
        workTagMoney.setContent("金融/银行/投资/保险");
        adapter.appendSingle(workTagMoney);
        WorkTag workTagBusiness = new WorkTag();
        workTagBusiness.setBgDrawable(R.drawable.shape_cornor_app_corlor);
        workTagBusiness.setTitle("商业");
        workTagBusiness.setContent("商业/服务业/个体经营");
        adapter.appendSingle(workTagBusiness);
        WorkTag workTagCulture = new WorkTag();
        workTagCulture.setBgDrawable(R.drawable.shape_cornor_app_corlor);
        workTagCulture.setTitle("文化");
        workTagCulture.setContent("文化/广告/传媒");
        adapter.appendSingle(workTagCulture);
        WorkTag workTagArticle = new WorkTag();
        workTagArticle.setBgDrawable(R.drawable.shape_cornor_app_corlor);
        workTagArticle.setTitle("艺术");
        workTagArticle.setContent("娱乐/艺术/表演/模特");
        adapter.appendSingle(workTagArticle);
        WorkTag workTagLaw = new WorkTag();
        workTagLaw.setBgDrawable(R.drawable.shape_cornor_app_corlor);
        workTagLaw.setTitle("法律");
        workTagLaw.setContent("法律/法务");
        adapter.appendSingle(workTagLaw);
        WorkTag workTagEducataion = new WorkTag();
        workTagEducataion.setBgDrawable(R.drawable.shape_cornor_app_corlor);
        workTagEducataion.setTitle("教育");
        workTagEducataion.setContent("教育/培训");
        adapter.appendSingle(workTagEducataion);
        WorkTag workTagGonver = new WorkTag();
        workTagGonver.setBgDrawable(R.drawable.shape_cornor_app_corlor);
        workTagGonver.setTitle("行政");
        workTagGonver.setContent("公务员/行政/事业单位");
        adapter.appendSingle(workTagGonver);
        WorkTag workTagAir = new WorkTag();
        workTagAir.setBgDrawable(R.drawable.shape_cornor_app_corlor);
        workTagAir.setTitle("空姐");
        workTagAir.setContent("空姐");
        adapter.appendSingle(workTagAir);
        WorkTag workTagStu = new WorkTag();
        workTagStu.setBgDrawable(R.drawable.shape_cornor_app_corlor);
        workTagStu.setTitle("学生");
        workTagStu.setContent("学生");
        adapter.appendSingle(workTagStu);
        WorkTag workTagOther = new WorkTag();
        workTagOther.setBgDrawable(R.drawable.shape_cornor_app_corlor);
        workTagOther.setTitle("其他");
        workTagOther.setContent("其他");
        adapter.appendSingle(workTagOther);
    }

    @Override
    public void onRetryClick() {

    }

    @Override
    public void onRefresh() {

    }

    @Override
    public void onLoadMore() {

    }
}
